/**
 * Created with WebStorm.
 * @Author: panda
 * @Date: 2022-05-18 09:24
 * @Description: 分类请求接口
 */
import {createRequestClient} from './axios/request';
import {APISchema} from "@/api/axios/type";

interface CategorySchema extends APISchema {
  getCategories: {
    request: {};
    response: {
      code: number,
      data: [
        {
          categoryName: string,
          id: string
        }
      ],
      msg: string
    };
  };

}

export const categoryAPI = createRequestClient<CategorySchema>({
  baseURL: process.env.NODE_ENV === 'development'
    ? process.env.VUE_APP_API_HOST + ''
    : '',
  apis: {
    getCategories: 'GET /categories',
  }
});
